/*
 * Session.h
 *
 *  Created on: 2013. 11. 8.
 *      Author: jjaehuny
 */

#ifndef PROJECTZ_NPROXY_SESSION_H_
#define PROJECTZ_NPROXY_SESSION_H_

#include <Dispatcher/Session.h>
#include <Network/Packet.h>

#include "../NUtil/ThreadPool.h"

#include <stack>

namespace ProjectZ { namespace NProxy {

class Session  : public ::Dispatcher::Session
{
public:
	class IOwner
	{
	public:
		~IOwner() {}
	};

public:
	Session();
	virtual ~Session();

public:
	virtual void	OnPacket();
	int				SendPacket(::Network::Packet * pPacket, bool bStatus);
	void			work();

	void			SetOwner(IOwner * pOwner);
	IOwner *		GetOwner();

private:
	std::deque< ::Network::Packet *> _clsWaitSender;
	std::mutex 	_mutex;

	IOwner *		_pOwner;
};

} /*NProxy*/ } /*ProjectZ*/

#endif /* PROJECTZ_NPROXY_SESSION_H_ */
